
-------------- DYNAMIC COPULA TOOLBOX --------------------

The toolbox is ment to estimate via maximum likelihood the parameters
of two different types of copulas, dynamic copulas (time varying correlations)
and copula vines. 
For both, only Normal or T copulas are assumed (no Archimedian copulas, since
in the multivariate case, the assosiaton parameter has no intuitive meaning)

CONTENTS

The toolbox consists of five folders. A brief description of the contents of
the folders follows:

ESTIMATORS: The routines in this file are the only files one needs for estimation.
Each file begins with the description of what it does, what are the proper inputs
and the outputs

LIKELIHOODS: This folder contains the likelihoods that are optimized by the routines
of the previous folder

FILTRATION: Functions to filter the initial data (returns of an asset).

UTILITIES: All 'helper' functions used by the other functions are located in utilities

SIMULATION: Functions to simulate time varying copulas or copula vines

USAGE

Install the toolbox in the usual MATLAB way (set path to the toolbox)

Imagine that you have a matrix of stock returns and you want to estimate a copula.
First you should filter the data. Open filtReturnsGARCH.m, follow the instructions and
extract the standardized residuals. These are used as the data for the copula parameters
estimaton. Then open the appropriate file from the estimators folder, run the function 
and you are done.

USUALL IMPUTS:

method: A string with values 'CML' or 'IFM'. When the residuals from the filtration are extracted
they are transformed to U(0,1) and then to standardized iid margins. The 'CML' method transforms 
the U(0,1) to iid with the empiricalCDF.m function of A. Patton, while if 'IFM' is chosen the
transformation is being made by the appropriate quantile function. 
WARNING: The 'IFM' method can create inf outputs and terminate the optimization, therefore
you are advised to use 'CML' all the time.

corrspec: For the time varying correlations there are three specifications used in this toolbox,
the DCC equation of Engle - Sheppard, denoted by the string 'DCC', the TVC specification of
Che - Chui, denoted by the string 'TVC' and Patton's specification denoted by the string 'Patton'.
patton is suitable only for bivariate problems!!

optimizer: String with values 'fmincon' or 'fminunc' for the function used for the nonlinear
optimization. Since these problems are constrained by nature, fmincon is the obvious choice,
however they can be unconstrained with simple transformation. One should use 'fminunc' if he wants
a numerical evaluation of grad & Hessian. However fminunc is a bit unstable sometimes and can
create errors in the optimization procedure. Bottomline: Use fmincon unless you want to calculate
the derivatives.


Be sure to follow the instructions of the routines!!!

AKNOWLEGEMENTS

Few of the functions of the toolbox are slight modifications of routines from the UCSD-GARCH
toolbox of Kevin Sheppard and from the Copula toolbox of Andrew Patton. The function randraw 
was created by Alex Bar Guy and was downloaded from www.mathworks.com
The Andrew Patton's toolbox for the skewT distribution was also used.

WARNING!

This toolbox may contain bugs or inconsistences. 

If you find any, please let me know at vogia@yahoo.com

The toolbox is free of charge for academic purposes.
For commercial use contact me at: vogia@yahoo.com

